package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.PrescriptionNoPayDetailQuery;
import com.mk.admin.model.query.PrescriptionNoPayQuery;
import com.mk.admin.model.query.PrescriptionStatusQuery;
import com.mk.admin.model.vo.*;
import com.mk.admin.service.PrescriptionService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/prescription")
@Api(tags = "门诊类")
public class PrescriptionController {
    @Autowired
    private PrescriptionService prescriptionService;

    @PostMapping("/selectHadPay")
    @ApiOperation(value = "opt_0011获取已缴费记录信息", tags = "处方", notes = "获取已缴费记录信息")
    public ResultDto selectHadPay(@RequestBody PrescriptionHadPayVo vo) {
        return prescriptionService.selectHadPay(vo);
    }

    @PostMapping("/selectHadPayDetail")
    @ApiOperation(value = "opt_0012获取缴费明细信息", tags = "处方", notes = "获取缴费明细信息")
    public ResultDto selectHadPayDetail(@RequestBody PrescriptionHadPayDetailVo vo) {
        return prescriptionService.selectHadPayDetail(vo);
    }

    @PostMapping("/selectHadPayBySerialNo")
    @ApiOperation(value = "opt_0013根据支付流水号查询", tags = "处方", notes = "获取缴费是否成功信息")
    public ResultDto selectHadPayBySerialNo(@RequestBody PrescriptionPaySerialNoVo vo) {
        return prescriptionService.selectHadPayBySerialNo(vo);
    }

    @PostMapping("/selectNoPay")
    @ApiOperation(value = "opt_0014未缴费处方查询", tags = "处方", notes = "查询未缴费处方信息")
    public ResultDto selectNoPay(@RequestBody PrescriptionNoPayQuery query) {
        return prescriptionService.selectNoPay(query);
    }

    @PostMapping("/selectNoPayDetail")
    @ApiOperation(value = "opt_0015未缴费处方明细查询", tags = "处方", notes = "查询未缴费处方信息")
    public ResultDto selectNoPayDetail(@RequestBody PrescriptionNoPayDetailQuery query) {
        return prescriptionService.selectNoPayDetail(query);
    }

    @PostMapping("/getPrescByDoctorId")
    @ApiOperation(value = "根据医生id查询处方信息", tags = "处方", notes = "获取处方信息")
    public ResultDto getPrescByDoctorId(@RequestBody PrescriptionVo vo) {
        return prescriptionService.getPrescByDocId(vo);
    }

    @PostMapping("/prescribe")
    @ApiOperation(value = "opt_0056开处方", tags = "处方", notes = "开处方")
    public ResultDto prescribe(@RequestBody PrescriptionAddBillingVo vo) {
        return prescriptionService.prescribe(vo);
    }

    @PostMapping("/examine")
    @ApiOperation(value = "opt_0057处方审核", tags = "处方", notes = "处方审核")
    public ResultDto examine(@RequestBody PrescriptionExamineVo vo) {
        return prescriptionService.examine(vo);
    }

    @PostMapping("/cancelBilling")
    @ApiOperation(value = "opt_0058处方取消", tags = "处方")
    public ResultDto cancelBilling(@RequestBody PrescriptionCancelBillingVo vo) {
        return prescriptionService.cancelBilling(vo);
    }
    @PostMapping("/statusQuery")
    @ApiOperation(value = "opt_0059处方状态", tags = "处方")
    public ResultDto statusQuery(@RequestBody PrescriptionStatusQuery query) {
        return prescriptionService.statusQuery(query);
    }

}
